package com.example.forum.controller;

import com.example.forum.commen.AppResult;
import com.example.forum.exception.ApplicationException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    @GetMapping("/exception")
    public AppResult testException() throws Exception{
        throw new Exception("这是一个exception");
    }
    @GetMapping("appexception")
    public AppResult testApplication() throws ApplicationException{
        throw new ApplicationException("这是一个ApplicationException异常");
    }
}
